package cn.zcq100.Proxp.Demo2;
import java.lang.reflect.*;
public class ProxpDemo {
public static void main(String[] args) {
	RealSubject real=new RealSubject();
//	Proxp proxp=new Proxp();
//	proxp.setSub(real);
//	
//	real.operation1();
//	real.operation2("zcq100");
//	
//	proxp.operation1();
//	proxp.operation2("zcq101");
	
	Subject sub=(Subject)Proxy.newProxyInstance(Subject.class.getClassLoader(), 
			new Class[]{Subject.class}, new InvokationHandle(new RealSubject()));
	sub.operation1();
	sub.operation2("test");
}
}
